<?php
/**
 * Created by PhpStorm.
 * User: weijer
 * Date: 2018/10/26
 * Time: 21:17
 */

namespace common\validate;

use think\Validate;

class FDD extends BaseValidate
{
    //验证规则
    protected $rule = [];

    // GetTenantRealNameAuthUrl 验证场景定义
    public function sceneGetTenantRealNameAuthUrl()
    {
        return $this
            ->append("param.tenant_id", "require|integer")
            ->append("param.re_new", "in:yes,no");
    }

    // GetUserRealNameAuthUrl 验证场景定义
    public function sceneGetUserRealNameAuthUrl()
    {
        return $this
            ->append("param.user_id", "require|integer")
            ->append("param.re_new", "in:yes,no");
    }

    /**
     * GetTenantQueryCert 验证场景定义
     */
    public function sceneGetTenantQueryCert()
    {
        return $this->append("param.tenant_id", "require|integer");
    }

    // Authorization 验证场景定义
    public function sceneAuthorization()
    {
        return $this->append("param.id", "require")
            ->append("param.operation", "require|in:0,1");
    }

}
